using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections.Generic;
using System.Collections;
using WEB.DAL.DBManagers;
using log4net;
using WEB.Exceptions;
using WEB.BLL.Entities;
namespace WEB.BLL.Services
{
    #region IExpertiseProjectService

    /// <summary>
    /// ExpertiseProject_Service object for Ibatis mapped table 'ExpertiseProject'.
    /// </summary>
    public class IExpertiseProjectService : BaseSqlMapDao
    {
        private static readonly ILog log = LogManager.GetLogger(typeof(BaseSqlMapDao).Name);

        public IList<ExpertiseProjectEntity> LoadData()
        {
            try
            {
                return ExecuteQueryForList<ExpertiseProjectEntity>("ExpertiseProjectLoadAll", null);
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                throw new DBException(ex.Message, ex);
            }
        }

        /// <summary>
        /// add new ExpertiseProject to DB 
        /// </summary>
        /// <param name="objE"></param>
        /// <returns></returns>
        public int Insert(ExpertiseProjectEntity objE)
        {
            try
            {
                ExecuteInsert("ExpertiseProjectInsert", objE);
                return 1;
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                throw new DBException(ex.Message, ex);
            }
        }
    }
    #endregion
}
